import 'package:mziot/app/data/group_info_entity.dart';
import 'package:mziot/generated/json/base/json_convert_content.dart';

GroupInfoEntity $GroupInfoEntityFromJson(Map<String, dynamic> json) {
  final GroupInfoEntity groupInfoEntity = GroupInfoEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    groupInfoEntity.id = id;
  }
  final String? groupName = jsonConvert.convert<String>(json['groupName']);
  if (groupName != null) {
    groupInfoEntity.groupName = groupName;
  }
  final String? groupImg = jsonConvert.convert<String>(json['groupImg']);
  if (groupImg != null) {
    groupInfoEntity.groupImg = groupImg;
  }
  final List<int>? sceneIds = jsonConvert.convertListNotNull<int>(json['sceneIds']);
  if (sceneIds != null) {
    groupInfoEntity.sceneIds = sceneIds;
  }
  final List<int>? deviceIds = jsonConvert.convertListNotNull<int>(json['deviceIds']);
  if (deviceIds != null) {
    groupInfoEntity.deviceIds = deviceIds;
  }
  final int? currentSceneId = jsonConvert.convert<int>(json['currentSceneId']);
  if (currentSceneId != null) {
    groupInfoEntity.currentSceneId = currentSceneId;
  }
  final String? sceneName = jsonConvert.convert<String>(json['sceneName']);
  if (sceneName != null) {
    groupInfoEntity.sceneName = sceneName;
  }
  final String? deviceName = jsonConvert.convert<String>(json['deviceName']);
  if (deviceName != null) {
    groupInfoEntity.deviceName = deviceName;
  }
  final bool? sceneLockStatus = jsonConvert.convert<bool>(json['sceneLockStatus']);
  if (sceneLockStatus != null) {
    groupInfoEntity.sceneLockStatus = sceneLockStatus;
  }
  final int? lightRate = jsonConvert.convert<int>(json['lightRate']);
  if (lightRate != null) {
    groupInfoEntity.lightRate = lightRate;
  }
  final bool? isClose = jsonConvert.convert<bool>(json['isClose']);
  if (isClose != null) {
    groupInfoEntity.isClose = isClose;
  }
  return groupInfoEntity;
}

Map<String, dynamic> $GroupInfoEntityToJson(GroupInfoEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['groupName'] = entity.groupName;
  data['groupImg'] = entity.groupImg;
  data['sceneIds'] = entity.sceneIds;
  data['deviceIds'] = entity.deviceIds;
  data['currentSceneId'] = entity.currentSceneId;
  data['sceneName'] = entity.sceneName;
  data['deviceName'] = entity.deviceName;
  data['sceneLockStatus'] = entity.sceneLockStatus;
  data['lightRate'] = entity.lightRate;
  data['isClose'] = entity.isClose;
  return data;
}
